3.1.23 \(\int (a+a \sec (c+d x))^2 \sin (c+d x) \, dx\) [23]

Optimal. Leaf size=43 \[ -\frac {a^2 \cos (c+d x)}{d}-\frac {2 a^2 \log (\cos (c+d x))}{d}+\frac {a^2 \sec (c+d x)}{d} \]

[Out]

-a^2*cos(d*x+c)/d-2*a^2*ln(cos(d*x+c))/d+a^2*sec(d*x+c)/d

________________________________________________________________________________________

Rubi [A]
time = 0.06, antiderivative size = 43, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 4, integrand size = 19, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.210, Rules used = {3957, 2912, 12, 45} \begin {gather*} -\frac {a^2 \cos (c+d x)}{d}+\frac {a^2 \sec (c+d x)}{d}-\frac {2 a^2 \log (\cos (c+d x))}{d} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(a + a*Sec[c + d*x])^2*Sin[c + d*x],x]

[Out]

-((a^2*Cos[c + d*x])/d) - (2*a^2*Log[Cos[c + d*x]])/d + (a^2*Sec[c + d*x])/d

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

Rule 45

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d
*x)^n, x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && IGtQ[m, 0] && ( !IntegerQ[n] || (EqQ[c, 0]
&& LeQ[7*m + 4*n + 4, 0]) || LtQ[9*m + 5*(n + 1), 0] || GtQ[m + n + 2, 0])

Rule 2912

Int[cos[(e_.) + (f_.)*(x_)]*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)
])^(n_.), x_Symbol] :> Dist[1/(b*f), Subst[Int[(a + x)^m*(c + (d/b)*x)^n, x], x, b*Sin[e + f*x]], x] /; FreeQ[
{a, b, c, d, e, f, m, n}, x]

Rule 3957

Int[(cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_.)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(m_.), x_Symbol] :> Int[(g*Co
s[e + f*x])^p*((b + a*Sin[e + f*x])^m/Sin[e + f*x]^m), x] /; FreeQ[{a, b, e, f, g, p}, x] && IntegerQ[m]

Rubi steps

\begin {align*} \int (a+a \sec (c+d x))^2 \sin (c+d x) \, dx &=\int (-a-a \cos (c+d x))^2 \sec (c+d x) \tan (c+d x) \, dx\\ &=\frac {\text {Subst}\left (\int \frac {a^2 (-a+x)^2}{x^2} \, dx,x,-a \cos (c+d x)\right )}{a d}\\ &=\frac {a \text {Subst}\left (\int \frac {(-a+x)^2}{x^2} \, dx,x,-a \cos (c+d x)\right )}{d}\\ &=\frac {a \text {Subst}\left (\int \left (1+\frac {a^2}{x^2}-\frac {2 a}{x}\right ) \, dx,x,-a \cos (c+d x)\right )}{d}\\ &=-\frac {a^2 \cos (c+d x)}{d}-\frac {2 a^2 \log (\cos (c+d x))}{d}+\frac {a^2 \sec (c+d x)}{d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.08, size = 31, normalized size = 0.72 \begin {gather*} \frac {a^2 (1-2 \log (\cos (c+d x))+\sin (c+d x) \tan (c+d x))}{d} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(a + a*Sec[c + d*x])^2*Sin[c + d*x],x]

[Out]

(a^2*(1 - 2*Log[Cos[c + d*x]] + Sin[c + d*x]*Tan[c + d*x]))/d

________________________________________________________________________________________

Maple [A]
time = 0.06, size = 34, normalized size = 0.79

method result size
derivativedivides \(\frac {a^{2} \left (\sec \left (d x +c \right )-\frac {1}{\sec \left (d x +c \right )}+2 \ln \left (\sec \left (d x +c \right )\right )\right )}{d}\) \(34\)
default \(\frac {a^{2} \left (\sec \left (d x +c \right )-\frac {1}{\sec \left (d x +c \right )}+2 \ln \left (\sec \left (d x +c \right )\right )\right )}{d}\) \(34\)
risch \(2 i a^{2} x -\frac {a^{2} {\mathrm e}^{i \left (d x +c \right )}}{2 d}-\frac {a^{2} {\mathrm e}^{-i \left (d x +c \right )}}{2 d}+\frac {4 i a^{2} c}{d}+\frac {2 a^{2} {\mathrm e}^{i \left (d x +c \right )}}{d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}-\frac {2 a^{2} \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}{d}\) \(103\)
norman \(-\frac {4 a^{2} \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )-1\right ) \left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}-\frac {2 a^{2} \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{d}-\frac {2 a^{2} \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{d}+\frac {2 a^{2} \ln \left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}\) \(113\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+a*sec(d*x+c))^2*sin(d*x+c),x,method=_RETURNVERBOSE)

[Out]

a^2/d*(sec(d*x+c)-1/sec(d*x+c)+2*ln(sec(d*x+c)))

________________________________________________________________________________________

Maxima [A]
time = 0.27, size = 41, normalized size = 0.95 \begin {gather*} -\frac {a^{2} \cos \left (d x + c\right ) + 2 \, a^{2} \log \left (\cos \left (d x + c\right )\right ) - \frac {a^{2}}{\cos \left (d x + c\right )}}{d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+a*sec(d*x+c))^2*sin(d*x+c),x, algorithm="maxima")

[Out]

-(a^2*cos(d*x + c) + 2*a^2*log(cos(d*x + c)) - a^2/cos(d*x + c))/d

________________________________________________________________________________________

Fricas [A]
time = 3.17, size = 51, normalized size = 1.19 \begin {gather*} -\frac {a^{2} \cos \left (d x + c\right )^{2} + 2 \, a^{2} \cos \left (d x + c\right ) \log \left (-\cos \left (d x + c\right )\right ) - a^{2}}{d \cos \left (d x + c\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+a*sec(d*x+c))^2*sin(d*x+c),x, algorithm="fricas")

[Out]

-(a^2*cos(d*x + c)^2 + 2*a^2*cos(d*x + c)*log(-cos(d*x + c)) - a^2)/(d*cos(d*x + c))

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} a^{2} \left (\int 2 \sin {\left (c + d x \right )} \sec {\left (c + d x \right )}\, dx + \int \sin {\left (c + d x \right )} \sec ^{2}{\left (c + d x \right )}\, dx + \int \sin {\left (c + d x \right )}\, dx\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+a*sec(d*x+c))**2*sin(d*x+c),x)

[Out]

a**2*(Integral(2*sin(c + d*x)*sec(c + d*x), x) + Integral(sin(c + d*x)*sec(c + d*x)**2, x) + Integral(sin(c +
d*x), x))

________________________________________________________________________________________

Giac [A]
time = 0.53, size = 51, normalized size = 1.19 \begin {gather*} -\frac {a^{2} \cos \left (d x + c\right )}{d} - \frac {2 \, a^{2} \log \left (\frac {{\left | \cos \left (d x + c\right ) \right |}}{{\left | d \right |}}\right )}{d} + \frac {a^{2}}{d \cos \left (d x + c\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+a*sec(d*x+c))^2*sin(d*x+c),x, algorithm="giac")

[Out]

-a^2*cos(d*x + c)/d - 2*a^2*log(abs(cos(d*x + c))/abs(d))/d + a^2/(d*cos(d*x + c))

________________________________________________________________________________________

Mupad [B]
time = 0.06, size = 41, normalized size = 0.95 \begin {gather*} -\frac {a^2\,\left (2\,\cos \left (c+d\,x\right )\,\ln \left (\cos \left (c+d\,x\right )\right )+{\cos \left (c+d\,x\right )}^2-1\right )}{d\,\cos \left (c+d\,x\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sin(c + d*x)*(a + a/cos(c + d*x))^2,x)

[Out]

-(a^2*(2*cos(c + d*x)*log(cos(c + d*x)) + cos(c + d*x)^2 - 1))/(d*cos(c + d*x))

________________________________________________________________________________________